<form action="" class="form-horizontal" role="form">

	<div class="form-group">
		<label class="col-sm-2 control-label">预约活动名称</label>
		<div class="col-sm-3">
			<input type="text" class="form-control" name="name" placeholder="" datatype="*" value="{$moduleSubscribe.name}"/>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label">预约填写项目</label>
		<div class="col-sm-5" id="items-checkbox">{$moduleSubscribe.itemsCheckbox}</div>
		<input type="hidden" id="items-hidden" name="items" value="{$moduleSubscribe.items}" />
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">按钮显示文本</label>
		<div class="col-sm-3">
			<input type="text" class="form-control" name="button_text" placeholder="" datatype="*0-8" value="{$moduleSubscribe.button_text}"/>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label">预约开始时间</label>
		<div class="col-sm-2">
			<input type="text" id="start-time" class="form-control" name="start_time" placeholder="" datatype="*" value="{$moduleSubscribe.start_time|date='Y-m-d H:m', ###}"/>
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">预约结束时间</label>
		<div class="col-sm-2">
			<input type="text" id="end-time" class="form-control" name="end_time" placeholder="" datatype="*" value="{$moduleSubscribe.end_time|date='Y-m-d H:m', ###}"/>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">预约说明内容</label>
		<div class="col-sm-5">
			<script id="content" type="text/plain">{$moduleSubscribe.content}</script>
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">预约结果内容</label>
		<div class="col-sm-5">
			<script id="result" type="text/plain">{$moduleSubscribe.result}</script>
		</div>
	</div>
	
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
		    <input type="hidden" name="id" value="{$moduleSubscribe.id}" />
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/modifyPost">保存更改</button>
		</div>
	</div>
</form>


<!-- datetimepicker -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.min.css"/>
<script type="text/javascript" src="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

<script type="text/javascript">

	$("#start-time").datetimepicker({
		
	    format: 'yyyy-mm-dd hh:ii',
	    language: "zh-CN",
	    autoClose: true,
	    startDate: new Date()
	    
	}).on( "changeDate", function(ev) {

		var startTime = $(this).val();
		$("#end-time").val(startTime);
		$("#end-time").datetimepicker({
			format: 'yyyy-mm-dd hh:ii',
		    language: "zh-CN",
		    autoClose: true,
		    startDate: startTime
		})	
		
	});
	
	$(function(){
		$("#items-checkbox input").click(function(){
			
			var res = [];
			$("#items-checkbox input").each(function(){
				if( $(this).is(":checked") ) {
					res.push( $(this).val() )
				}	
			})
			$("#items-hidden").val( res.join(",") );
		});
	})
</script>

<!-- ueditor -->
<link rel="stylesheet" href="/ue/themes/default/css/ueditor.min.css">
<script type="text/javascript" src="/ue/ueditor.config.js"></script>
<script type="text/javascript" src="/ue/ueditor.all.js"></script>
<script type="text/javascript">
	window.UEDITOR_HOME_URL = "/ue/";
    var editor = UE.getEditor("content",{
    	initialFrameWidth: "100%",
	    initialFrameHeight: 200,
	    textarea: "content"
    });
</script>
<script type="text/javascript">
	window.UEDITOR_HOME_URL = "/ue/";
    var editor = UE.getEditor("result",{
    	initialFrameWidth: "100%",
	    initialFrameHeight: 200,
	    textarea: "result"
    });
</script>